 public  List<Map<String,Object>>  autoSettleDetailCheckBefore(SettleReport settleReport,Date firstDate,Date lastDate,List<SettleReportDetail> datas) {
        List<String> titlelist=new ArrayList<>();
        if (settleReport.getSettleReportType().equals("cus")) {
            titlelist.addAll(Arrays.asList("销售订单号","单价"));
        }else{
            titlelist.addAll(Arrays.asList("服务订单号","单价"));
        }
        int count;
        int page=1, pagesize=200;
        String fileUrl = settleReport.getFileUrl();
        Set<String> processedOrders = ConcurrentHashMap.newKeySet();
        List<Map<String,Object>> dateSouceDataList=new ArrayList<>();
        do {
            // 获取文件数据
            List<List<String>> lists = null;
            try {
                lists = ExcelUtil.readExcelBatchPriceConfigure(fileUrl, page, pagesize);
            } catch (IOException e) {
                log.error("{}读取文件失败",settleReport.getFileName());
                settleReport.setUploadFailureReason("读取文件失败！");

                throw new RuntimeException(e);
            }
            count = lists.size();
            if(page==1) {
                count=count-1;
                // 模板表头校验
                List<String> titles = lists.get(0);
                if(titles.size()!=2){
                    settleReport.setUploadFailureReason("对账文件表头与模板不匹配");
                    log.error("对账文件表头与模板不匹配({})",settleReport.getFileNum());
                    break;
                }
                boolean validateFlag = validateHead(settleReport, titlelist, titles);
                if (!validateFlag){
                    break;
                }
                lists.remove(0);
            }
            if(count>0){
                SettleReportDto.AutoSettle2 input = new SettleReportDto.AutoSettle2();
                input.setEndSettleDate(lastDate);
                input.setStartSettleDate(firstDate);
                input.setExcleData(lists);
                input.setSettleReport(BeanCopyUtil.beanCopy(settleReport, SettleReportDto.AutoSettle2.SettleReport.class));
                // 获取对账单的数据
                List<Map<String,Object>> dateSouData = getDateSouDataDetail(input,processedOrders,datas,titlelist,settleReport.getFileNum());
                // 数据校验，保存对账记录
                String uploadFailureReason = input.getSettleReport().getUploadFailureReason();
                if (StringUtils.isEmpty(uploadFailureReason)) {
//                    log.info("处理批量结算明细文件");
                    dateSouceDataList.addAll(dateSouData);
                }else{
//                    log.error("导入批量结算明细失败！");
                    settleReport.setUploadFailureReason(uploadFailureReason);
                    break;
                }
            }
            page++;
        } while (count > 0);
        processedOrders.clear();
        return dateSouceDataList;
    }

    //遍历
    public static List<List<String>> readExcelBatchPriceConfigure(String fileUrl, int pageNo, int pageSize) throws IOException {
        MongoFileClient client = MongoFileClient.createDefaultClient("/");
        byte[] byPath = client.getByPath(fileUrl);
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        baos.write(byPath);
        InputStream is = new ByteArrayInputStream(baos.toByteArray());

        List<List<String>> resultList = new ArrayList<>();
        try {
            // 创建 Workbook 对象
            Workbook workbook = WorkbookFactory.create(is);
            Sheet sheet = workbook.getSheetAt(0); // 假设只处理第一个工作表
            DataFormatter dataFormatter = new DataFormatter();
            // 计算开始读取的行号
            int startRowNum = (pageNo - 1) * pageSize;
            int endRowNum = Math.min(startRowNum + pageSize, sheet.getLastRowNum() + 1);

            // 获取表头行的单元格数目
            int headerRowCount = sheet.getRow(0).getLastCellNum();

            // 读取指定范围内的行
            for (int i = startRowNum; i < endRowNum; i++) {
                Row row = sheet.getRow(i);
                if (row != null) {
                    List<String> rowValues = new ArrayList<>(headerRowCount);

                    // 初始化单元格值列表
                    for (int j = 0; j < headerRowCount; j++) {
                        rowValues.add("");
                    }
                    // 处理单元格
                    Iterator<Cell> cellIterator = row.cellIterator();
                    while (cellIterator.hasNext()) {
                        Cell cell = cellIterator.next();
                        int columnIndex = cell.getColumnIndex();
                        if (columnIndex < headerRowCount) {
                            String cellValue = getDefaultCellValue(cell, dataFormatter);
                            rowValues.set(columnIndex, cellValue);
                        }
                    }
                    resultList.add(rowValues);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

        return resultList;
    }